<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>在此处插入标题</title>
<script src="js/jquery.min.js"></script>
<script src="js/echarts.min.js"></script>
</head>
<body>
<div id="main" style="width:600px;height:400px;"></div>
<script>
	
	var names=[];
	var scores=[];
	var page=1;
	var pageSize=4;
	
	$(function() {
		
		$.ajax({
			url:"http://localhost:8080/student/queryByPage",
			type:"post",
			dataType:"json",
			data:{
				page:page,
				pageSize:pageSize
			},success:function(students){
				
				for(var i=0;i<students.length;i++){
					names[i] = students[i].studentName;
					scores[i] = students[i].studentScore;
				}
				drawPic();
			}
			
		});
		
	});
	
	function drawPic(){
	
		var myChart = echarts.init(document.getElementById('main'));
		option = {
			    xAxis: {
			        type: 'category',
			        data:	names
			    },
			    yAxis: {
			        type: 'value'
			    },
			    series: [{
			        data: scores,
			        type: 'line'
			    }]
			};
		myChart.setOption(option);
	}
	
</script>
</body>
</html>